package com;

import net.sf.json.JSONObject;
import org.tempuri.DPO1;
import org.tempuri.ODPO;
import org.tempuri.SAPServicesSoapProxy;

import java.rmi.RemoteException;
import java.util.Calendar;

/**
 * @author ZhangLei
 * @date 2021/8/10
 */
public class test {

    public static void main(String[] args) {
        SAPServicesSoapProxy sapServicesSoapProxy = new SAPServicesSoapProxy();
        String result="";
        Calendar cal = Calendar.getInstance();
        cal.getTime();
        Calendar duecal = Calendar.getInstance();
        duecal.getTime();
        Calendar taxcal = Calendar.getInstance();
        taxcal.getTime();
        Calendar uTScal = Calendar.getInstance();
        uTScal.getTime();
        Calendar shipcal = Calendar.getInstance();
        shipcal.getTime();


        ODPO odpo = new ODPO();
        odpo.setCardcode("test");
        odpo.setDocdate(cal);
        odpo.setDocduedate(duecal);
        odpo.setTaxdate(taxcal);
        odpo.setU_TS_QRRQ(uTScal);
        ODPO[] odpos = {odpo};

        DPO1 dpo1 = new DPO1();
        dpo1.setU_TS_BOMQ("test");
        dpo1.setShipDate(shipcal);
        DPO1[] dpo1s={dpo1};
        try {
            result = sapServicesSoapProxy.SAP_ODPO(odpos, dpo1s);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        System.out.println(result);
        JSONObject jsonObject = JSONObject.fromObject(result);
//        System.out.println(jsonObject.toString());
        System.out.println(jsonObject.size());
        Object isSuccess = jsonObject.get("isSuccess");
        Object message = jsonObject.get("message");
        System.out.println("isSuccess的信息是："+isSuccess);
        System.out.println("message的信息是："+message);
    }
}
